I considered going straight to the harness coming out of the ECU, but opted to go with where I had a little more room while the engine was out which was right at the top of the transmission where there is a connection between two plugs. You may find it easier to tap in at a different location, say, further down the line towards the bottom of the car, or the other direction closer to the firewall.
Plug for the Rear O2 sensor on top of transmission (you may also use TGV Left or TGV Right).
We want the wire that communicates voltage changes from the rear O2 sensor to the ECU, which is the solid white wire on the 2008+ STi (check your year)
Reconnect the plug. *kind of important, haha
I fed the wire through boot for the Right Hand engine harness, then silicone'd over the slit I made. The wire will come through behind the glovebox area.
My AEM UEGO gauge's 12v ACC source is tapped into the radio harness and grounded nearby. The 5v output wire for logging (also conveniently a solid white wire) will connect to the yellow wire that we just routed behind the radio.
Make the necessary changes to your map for AEM UEGO scaling before monitoring. (helpful link from Cobb )

Log/monitor the parameter "Sensor Input Monitor Only (Rear O2)" or "Sens Only Rear O2" on your AP v3

*Note - you can also use TGV Left or TGV Right for monitoring and logging. Just depends on what you want to tap into, and what might make for the easiest access.
**Note - Just another note to anyone installing a AEM X-Series Wideband UEGO with the Bosch LSU 4.9 sensor, you also need to ground the BROWN wire for analog sensor ground. Otherwise it wont output 0-5v to the ecu.