My old tractor was doing the same.
Replaced coil fixed it.
Also, open fuel tank cap as soon as motor dies, do you hear a swish of air entering the tank. If so, your fuel tank cap could have gotten stopped up. Your tank must be properly vented for the fuel to flow. Let us know what you find wrong.