The prime clue is if the generator remains running after you release the start switch, it is producing electricity. The Onan control board will shut down the engine if the generator is not producing AC voltage. So check things external to the generator itself. There are two circuit breakers on the generator, sometimes kind of hidden, or you may have a loose connection from the engine vibration. Or a problem in the transfer switch, which is external to the generator, usually near the rig's main breaker panel.