Good Day!
Like Mark says, classic FSD/PMD symptoms. I think the best bet is to get an extension harness & mount it in front of the driver-side battery, or go with Heath's unit.
"He replaced the fuel filter and fuel pump, but it still has the same problem." Did he actually determine if the LP* was defective or not? Your truck should run fine even if the LP is dead or not getting power. The most common symptom of a failed LP system is a miss under load just like a gasser with an ignition miss.
"I suspect an intermittent electrical problem that causes the fuel pump to stop working." If it were me & I had to know, I'd go to the boneyard & clip the wires to the LP, before & after the LP. That would give you both connectors, so you could make up a jumper that would add two wires to be temporarily strung into the cab. You could then connect a small 12V lamp to the two wires. Be careful troubleshooting this way, I think the PCM in trucks after 95 might be switching the LP on & off; earlier trucks like mine powered the LP through the OPS whenever the engine is running. As I said, however, I highly doubt your LP has anything to do with your symptom.
Be careful of terminology: there are three fuel pumps on your truck, the lift pump, a fuel pump built into the injection pump (which is why it'll run without the LP), & the injection pump itself.
It was nice of you to include your email address, but keep in mind: if you troubleshoot outside these forums, the only person that profits by your new-found knowledge is you, the rest of us will never know what you did & what fixed it. When your troubleshooting is done in the forums, all of us gain your knowledge. It's what's allowed a poor mechanic (me) to keep my trucks running.
Blessings!
*LP = Lift Pump
82 6.2NA K15 4X4 pickup, 4spd man w/ OD, 335K+ "In Rust We Trust" (parked)
95 6.5TD 2500 4X4 pickup, Gear Vendors Aux. OD, > ¼ million miles - gone
95 6.5TD 1500 4X4 3/4T Suburban, Kennedy exhaust, > ¼ million miles
93 6.5TD 3500 4X4 1T crew cab LB pickup, 230k miles