Yes, transformer can be used for filtering out the DC signal when the data is passing through the MDI side. In fact, we use transformer to filter out the AC signal in the Power over Data Line (PoDL) application. Here are the two way that you can use to filter out the DC signal in the MDI side:
--
Regards,
Hillman Lin