Did your check engine light (CEL) come on, or are you getting any CEL codes?
Auto trannys are so complex it's hard to diagnose problems. But if it's something like a throttle position sensor, speed sensor or solenoid it will usually trip a CEL code. I know the 4-speed Ford auto that's in the early late 90s early 00s Rangers, are known for solenoids going bad, which causes the symptoms you describe.
If the check engine light isn't on, then it might be something more complicated and expensive.
My brother paid AAMCO thousands of dollars to replace the tranny in his Mazda MPV, (another Ford tranny) which they told him was toast. 1 month later it was having the same issues, after taking back in, and having it at the AAMCO for another week they were clueless. He finally took it to the dealer where in an hour they figured out it was a $50 part Mazda knew was prone to failure, in fact they had issued a service bulletin about it years earlier, but AAMCO was to stupid/lazy to check the service bulletins.
So they replaced it for <$200 after he'd paid AAMCO thousands to "fix" it. And no AAMCO did not refund him any money.
Moral of the story:
Always get a second, third and fourth opinion when it comes to major auto repairs.