reteaching is done by tuning on the ignition (but not starting the motor) and while holding the brakes, move the gear selector to each gear (r, n, d) and waiting a bit between changing positions until all the clunking stops before going to the next gear.
Holding the brake will keep you from rolling away while the transmission 'finds' each gear
pretty sure it is covered in the owners manual