It is pin 1 and 4.
https://www.clubvr4.com/forum/showthread.php?45151
It should store the code even if turning the car off and on resets the gearbox. I'd try it as normal rather than try and connect wires with the engine running. You can short pins 1 and 4 and leave them shorted. The lights are annoying when stationary but once moving the dash returns to normal.
I wouldn't mess with the solenoids personally. I'd want to understand it properly before I messed it up!
Why not remove the bell housing and have a look at the centre diff and output shafts?