I would rule out sticky clutch or sidestand switches but my immediate instinct is that your pickup coil (crank position sensor) is on the blink. They are about £40. Coils typically give out when hot and come back to life as they cool before dying for good. If you suspect fuel had you just refuelled?
You will need a multimeter/ohmmeter and are looking for a resistance of about 530 ohms +/- 10%. Ideally you test resistance values cold and hot.......like in a pan of hot water which means partially disassembly. There is a two wire lead from the crank sidecover to the igniter that has a connector where you can put the meter probes. You will also need a new RH side gasket and keep it well canted on the sidestand so you lose no oil.
+1 for the CPS being suspect. Just in case there is a bit of muck in the carbs and/or petrol, stick a goodly slug of Redex or similar in the fuel tank. Even if it isn't muck , at least it will give the carbs etc a bit of a clean up which can only be a good thing (I sometimes think my bike has a Redex addiction, but it still pulls like a train! So no worries really.).
I dont think there is a way of checking it if I recall right. there is a setting of a gap but if the bike was running well before it died and after it cooled that seems to rule a check unnecessary. Likewise the fuel, it was running well before and after so i would guess the fuel is ok too. Just my 2 pennorth but i would change the cps as stated previously, it is a well known fault