Hi and Welcome!
The XEDE was a popular piggy back ECU before flash tuning took over. It's an "inteceptor" ECU, meaning it intercept the signals to and from sensors and ECU and presents the ECU with what it expects to see while applying variations - basically making the XEDE responsible for tune while fooling the ECU into behaving as though everything is stock.
I can't recall exactly how they were commonly mounted - Chiptorque may be the best source of info on that, however I don't think they were especially far from the stock ECU - I don't recall cables being hugely long. You'd be able to trace the cables from the OEM ECU to the xede, I expect.
Behind the glovebox or possibly even in the glovebox. I'm sorry can't recall if it would be fitted in the engine bay itself; it may be.
"Blue Meanie" 2007 Aurora Blue MPS 3 - 18x8.5+44 SSR GTX01 - 235/40R18 Michelin PS5 - 3.5" ETS TMIC - CPE stg 2 mount - HKS/CPE BPV - 2XS inlet - 2XS short shift - Corksport turbo manifold - HT 98 octane tune - Leather/Aluminium handbrake - Momo shifty knob - 7" touchscreen - JDM Mazda Retractable dashtop screen assembly - Bespoke Raspberry Pi Android based GPS/Carplay and instrumentation - 36AH reserve battery and C-TEK isolator - TEIN Street Advanced coilovers 1" drop - Superpro bushings - 220Kw/410Nm.
"Lipstick" 2013 Velocity Red MPS 3 - 18x7.5+48 Enkei RPF1 -225/40R18 Federal RS-RR - CPE TMIC - COBB inlet - CPE stg 2 mount - COBB Stage 1 98 octane tune - COBB shifty knob - 2XS short shift - 2XS turbo manifold.