They are connected to the 3 shift solenoids. If you pull the pan and the filter, you can unplug the wires from the inside and pull them back out the hole.
You may also have another sensor related issue to deal with. In 1996/7, with the switch to ODBII, a front shaft speed sensor was added to the AW4 and the rear speed sensor changed design and number of pulses/revolution. The rear sensor changed from a magnetic type switch giving one closure per revolution to an inductive pickup with 4 pulses per revolution. The older sensor is longer and will not fit into the newer tranny unless you swap the rotor that is pressed onto the rear output shaft.
Does your 98 tranny have a sensor on the drivers side just aft of the bellhousing that the 96 does not? If that's the case, you will need to either use the 1998 TCU or pull the rear of the trannies and swap the rear speed sensor and rotor. The FSM shows how to get at the rotor and pull it off the end of the output shaft. If you go with the 1996 TCU and swap the rotor/shaft you can just leave the front sensor unhooked.
Oh, the NSS is identical between the years, but I believe the connector on that changed as well. Just use your old one.