If pumping the fuel primer bulb constantly by hand, acting as a manual fuel pump, causes the problem to cease... the cause of the problem would be in the fuel system, not the ignition system (faulty fuel pump?), however...........
Do a close visual check of the stator under the flywheel. If it should be dripping a sticky looking substance down on the timer-base and powerhead area, that would indicate it has encountered a meltdown problem. That would result in a AC voltage drop to the powerpack capacitor which, in turn, when hot, would result in weak, erratic, and eventually no spark.
A stator in the early stages of this type failure may very well function properly when cold, but when hot loses its voltage production power.
Also, check the timer-base to see if it has a tendency to stick, more likely to take place when the engine is hot rather than cold... BUT... when cold is also possible.
Fouled carburetors will also result in having the engine fall on its face, so to speak... BUT... carburetors do not come and go, back and forth. If they're faulty, they stay that way... so this being the cause is unlikely.