Next time this problem happens, check for spark. The coil could be intermittently going open when hot and causing a no spark condition. Typical symptom is when the engine gets hot is dies and after it cools down it will restart and run fine until it gets hot again.
Don't buy a coil until you verify it is defective. When you do find the problem, please come back to this thread and tell us what ultimately fixed your problem.