If it runs strong for a mile and it restarts after a couple tries, i wouldn't suspect electrical problems. More likely is it is running out of fuel. One indication would be that the engine surges just before it dies.
Take it for a ride (Bring some tools). Make it die.
Immediately shut off the petcock so no fuel can flow into the carb.
Remove the carb or the float bowl and see if there's any fuel in the bowl.
If fuel level in the bowl is low, go home and clean out the entire fuel path from the vent in the gas cap down to and including the carb.
Remove the fuel hose from the carb and turn on the petcock. Good fuel flow means a steady, thick stream of fuel exits that hose .. anything less can give symptoms of running out of fuel.
The float bowl should be full of fuel under all riding conditions.