My favourite first things to check are the pick-ups down by the flywheel. The wiring to them can get chafed and wear through. Then they can short out against the crankcases. It can be an intermittent fault depending on how the vibrations affect the wiring.
You need to remove them to check their condition.