This could be a couple of things. Like
1 said, it might be the gas tank vent tube being clogged, and taking off the gas cap will let you know if that's what the problem is, as the bike will start and run fine without the cap on, but when you put the cap back on, it will die a little later. Another possibility is the coils. If there is a crack in the coil, it will run fine for a while, until that coil heats up and separates, causing the bike to die, and not be able to start until it's cooled off enough to get closer together so the spark can jump the gap again, and then runs until it heats up and separates and dies again. You should also check the 3-yellow wires, as that can cause all kinds of trouble, including not starting or dying. You can get a replacement for that connector for about $3, if it's burned/fried. Another possibility is the start switch itself. Open the switch housing, and check it for loose wires and good contact, clean it, and put it back together. However, that usually
is seen with pushing the start button, and nothing happens but the lights going out.