Quoted from the Complete Car Care Manual by Popular Mechanics:
“Does the harsh shifting occur only in one gear change…? The accumulator is something to suspect on fully hydraulic and partly electronic automatics. Most hydraulic clutch/band circuits have an accumulator, which is a spring-loaded piston assembly in a chamber, to prevent shift shock. If the chamber is filled with sludge or the piston spring is broken, it could be responsible. If the accumulator is external, you can remove the cover and look inside.
Of course, a sludge-filled or varnished accumulator chamber could indicate a varnished valve body under the oil pan. So one harsh shift now could become harsh shifts soon. However, just cleaning out the external-access accumulator now could be smooth-shift news for a long time.
If the accumulators are on the valve body, the job is more difficult because you’ll have to remove the oil pan. But at least you get a look at the valve body too. Refer to a service manual to see what’s involved in an inspection” (Popular Mechanics 143).
Complete Car Care Manual. New York: Hearst Books, 2008. Print.
You can either ask a mechanic at a shop or look in a book to find out if (a) your car in particular has an accumulator, (b) where both that and the valve body are located, and© how to get at and clean both of these, if they do need cleaning.