Back to some basics... backfiring through the throttlebody is caused by firing of combustible material in the cylinder when there is a path to the intake manifold open, allowing gases to enter the manifold.
1. Possible causes.
Electrical system problem:
as mentioned, bad wires and arcing between them or some other component allowing cylinder to fire when the intake valve is open.
timing changes caused by worn cam gear or timing chain moving one or more ignition points to cause detonation with a valve open.
Intake valve sticking open (since it happens when engine is hot, may be the culprit - bent valve or weak return spring changing dimensions enough to bind or not allow closure of the intake valve.
2. How to identify:
Electrical system problem:
bad wires or arching
Operate engine in the dark - look for arcs between wires (it can be pretty but causes problems. Wiring can look good and still fail. 5 years/50K miles is a good point for your engine to consider replacing them as a maintenance item.
You can inspect the boots for "carbon trails", thin black lines indicating rubber that has been converted to a path for high voltage electrical voltage to travel.
Timing changes should kick a fault to your engine control computer, but only way to ensure timing is correct is to hook a diagnostic computer up to engine (old folks would use a timing light). Of course included here is possible bad ECU. The computer should be instructing engine when to fire.
The only real way to identify sticking valves is to perform a pressure check on each cylinder or even better to perform a cylinder blow-down test.
3. Repair depends on what you find.
4. Based on also having a loss of power when engine warms up, I would expect timing or sticking valve.
IMO I don't believe lean fuel should cause a backfire through the throttlebody . A vacuum leak, if the distributor is vacuum controlled advance, could cause problems including backfiring.
Good Luck