Which engine does it have?
How many miles on vehicle?
Did the dealership check for codes? IF so what were the codes?
To check for codes do the key dance> turn engine switch on/off, on/off, on without starting engine within 5 seconds and any codes present in the PCM will be shown where the mileage is recorded on the vehicle (odometer). Post any codes that it shows.
sounds like the transmission goes into the limp mode which protects the tranny when there is a problem. It could be the input sensor in the tranny is going bad.
I would not drive it much until you can solve the problem.