Either spark is going away or fuel supply is. I'd check fuel first since that is free and easiest. When the bike quits, crack the float bowl drain screw and see if there is gas. Petcock all the way on. Vent in gas cap (though I'd expect the bike to run further before dying). Petcock filter stopped up. Rubber smiley in petcock messed up or full of crud. Crud in screen above needle valve.
One post is enough.