It could be dirty or worn transmission fluid or filter or a dirty fuel filter or bad plugs or wires or even bad connections on the ignition module where the wires plug into.Even a bad air filter can cause such problems or a bad cat converter or dirty injectors etc.
I'd start with changing the...