WARNING: This page is about a different car, the 2017 Subaru Outback and 2017 Subaru Legacy. However, it is still accessible from the selected car via links, so may be relevant.
Fig 1: AT Shift Control System Wiring Diagram (Without Push Button Ignition Switch)