First, I would suppose both are HID devices.
I don't have a Xbox but I do have a PS4, and I just checked connecting one controller via USB to a PC. The controller shows up as "Sony Corp. DualShock 4" and can be used as a regular joystick.
Not sure about the Xbox, but I suspect this is the same. So if that's the case (which is likely), it will mostly be a matter of matching controls from one controller to the other.
This could be done with a MCU of course, but you'd need one with two USB OTG controllers, one programmed as host and the other as device.
IIRC (although i've never tested myself), RPi's can be used as USB devices on one of their USB ports. If that's indeed the case (someone here may have more info/already done that), then this would probably be the easiest path for what you want to achieve.