If the fuel pump is crapping out, low fuel pressure could do it. You should end up with a lean code though for the o2 sensors if it is doing that.
As
@najer said, it could be the maf, but 97-98-99 f150s have very sensitive computers and even a small hiccup usually kicks a light. One way to test is to clean the maf and see if it improves. Use only cleaner specifically made for a maf though.
In all honesty diagnosing over the web sucks lol. In person, I could throw a scanner on it and drive to record sensor data. Then could nail it down quickly.