SMP,
I had a like problem: KX125 ran great until it got warm (approx 10-15 min.) and then would just die (pulled the plug, damp with fuel) let the bike cool down for a couple minutes and would start up and repeat the whole process. Checked the stator and coil with a meter (checked OK), borrowed a CDI thinking this would surely be the fix, and the problem still persisted. Removed the coil from my 250 (same part #) and installed, the problem was fixed. Ordered a new coil, installed it, went to the race track, problem was still there. Pulled the 250 coil again and installed problem fixed.
Bottom Line: It was a bad Plug Cap (Resistor Cap/When it would get Hot it would Open and loose contact). New coil did NOT come with a cap, removed the cap from the old coil and installed. Try removing the plug cap and run the coil wire direct to the plug.
I hope the solution tp the problem is simple as this! (keep us posted)