Not familiar with this engine, but others, usually cars, often have a fuel shut off solenoid. This shuts off the fuel when the ignition is switched off to prevent "running on" due to the "lean burn" anti emission settings which can cause this.
When the engine cuts out check that there is power being supplied to the solenoid. If not, check wiring and connections back to power feed. If appears ok. waggle wiring and connections to make sure vibration is not breaking the circuit. If ok, without engine running, turn ignition on and off and try to hear the solenoid click. Its not unknown for the solenoid's internal coil to break down as the current flow will cause a small build up of heat. If none of the above works renew the solenoid.
Mr. Toad, July 2008