When the mower shuts off you need to immediately check for spark. I'm guessing you won't have any.If you don't have spark you need a coil, common problem.If you have spark things gets a lot more complicated. Test for spark, if you have spark post a follow up. I'm 99% sure we don't need to go into the 500 word essay on what else could be wrong.
Sounds like old fuel problem. Try a fresh batch of fuel. If that fixes the tractor, then drain your fuel storage and add fuel stabilizer to your storage tank next time.
Does it always crank?...If so, it may be a fuel mixture problem...Not enough air/gas ratio, causing it to quit. Clean out carbuerator...check all vacuum points.
Perhaps your bib overalls are caught in the drive unit.