The seat switch or the wiring between the seat switch & the PTO switch is dodgy or if it is one of those no key models , then the control module is dodgy
The mower thinks ( as much as a mower can think ) that there is no one in the seat so it shuts off so it can not run over you .
If you release the brake then it will probably turn off as well
So your first stop is the cub cadet web site to get a wiring diagram for your mower.
They used to be in the parts books
Check the seat switch wires and the switch itself
The circuit is usually a ground circuit so if the wires are pinched or chaffed ( very common) and they find ground then the circuit is activated .
Some times is is just a loose plug , some time the housing breaks , come times the switch is just bad .