The transponder will not interfere with the magnetometer electrically, only the mounting hardware will. I'd keep a foot between them if possible, but less is likely OK.
The GPS should be on the top side of the plane and the transponder antenna on the bottom. You'll have no issues if you do this. If you put them both on the top, you need 2 feet.