If holding the switch makes it keep running, my first thought would be a bad switch. Can you test the switch? If they're inexpensive, replacing that would be a reasonable place to start.
Alternately, if you have contact cleaner spray, you could try spraying that inside the switch, and working it back and forth a bunch of times, to see if you can help the internals make better connections.
Or, if I misunderstood the switch behavior, how does the tractor behave if you stand up from the seat while the PTO is engaged? If the engine stays running, but the PTO shuts off, then maybe you have a bad seat safety switch, or an intermittent connection to that switch.