Connect Ethernet pairs directly to PCB with 'magnetics' IC instead RJ45 MagJack?
The idea behind the magnetics is to isolate the grounding of the differential pair (for esd and stopping DC currents), the second is to create impedance with common mode chokes to stop common mode noise.
Locating the magnetics away from the phy could create problems, but is doable if you do these things:

Ethernet differential lines need a characteristic impedance of 100Ω, make sure the lines cables and connectors leading up to the magnetics are routed as differential lines and have the proper impedance. So if you are soldering pairs, and you can maintain a 100Ω characteristic impedance then then go for it.

Locating the magnetics away from the phy could introduce noise. Why? because you no longer get the benefit of the common mode choke in the magnetics. The longer you make the cable between the phy and magnetics, the larger loop area and more chance that the ground of the phy and the ground of the magnetics will be a different potential. Make sure that the ground of the phy side of the magentics and the phy are the same.


If the environment is noisy this could be a problem, the best way to check would be to build the design then check the eye diagram with a differential probe.