In UE 5.3, using the Input Device Subsystem worked really well for me:
The Hardware Device Identifier comes back telling you the specific gamepad, if you want to switch between PlayStation and Xbox controller specific UI. For example, the keyboard and mouse returns “KBM” and an Xbox controller returns “XInputController”.