Truck drops gear while driving, is it the TPS or Transmission? on 1998 Dodge Ram 1500

When driving the truck will drop out of gear. Have to shut it off. Sometimes cant get the key out and it wont shift. Have to wait til someone can push the truck a bit for it to shift. Could this be the TPS? or should I be thining the transmission is going?

Asked by for the 1998 Dodge Ram 1500