New results: It turns out the used transmission I bought was not for a 97 Intregra LS. One of the solenoids had an 8 wire plug, where my car is fitted with a 4 wire plug. The local mechanic that installed the used transmission never hooked it up. According to Aamco, that would explain all the slipping and flaring.
Just got home with the original transmission reconditioned by Aamco. Works great.
Now, if I can figure out, from the serial number, as to just what kind of car the used transmission belongs to I might be able to save it from the junkyard.