This should be in the "SN95 4.6 Tech" section.
Engine wise, what you are doing is basically a PI engine swap. Plenty of ppl have done it. This swap will be somewhat more complex because the 99 had a Windsor block and the 97 has a Romeo block. Have you searched?
Transmission wise, be advised that the 96-98 MY uses a VSS sensor. Where as the 99+ uses an output shaft sensor (OSS). The two sensor's output are NOT compatible with each other. Also, many of the Speedcal units do not work with an automatic transmission.
Also note that there it is likely that the digital transmission range selector (DTR) is different between the two MY.
It may be possible to transplant the VSS and DTR from the old transmission to the new. However, some dis-assembly will be required. For just how much, you should contact an transmission specialist.