Ford 4R70W transmission compatibilities

I have a 1994 Mercury Cougar, and its recently started throwing codes pointing at the Shift Solenoid. The problem has grown to the point where it just won’t shift between anything other than reverse and 1st. I’m unsure if it is the solenoid itself or if there is a larger issue at hand, but regardless…
What I am wondering is:
I see that the 4R70W is a very common transmission type among ford cars, could I take a trans from say… a 98 Grand Marquis or something with that same trans and fit it to my Cougar here without issue?