You could have an issue as "simple" as a broken motor mount (or two...or three...), or as complicated as an internal transmission issue. It would be hard to say for sure over the Internet. However, there are a couple things you can do.
1) open your hood, have a friend "brake torque" the engine, that is, foot on the brake to keep the car still, "goose" the accelerator in drive or reverse. Watch the engine while this is happening - does it move significantly fore and aft in the engine compartment? There should only be a modest amount of "lift" or twisting of the engine. If it moves a lot, motor mount(s) might be broken.
If not...check the transmission fluid. Is it full? Low? Red? Brown? Smell burnt? Low fluid could cause engagement issues and internal damage - so add some if it's low. Brown or burnt fluid is an indication of fluid overheating, possible caused by or causing damage internally.
Good luck!