Program Rog Ally buttons to keyboard keys for games?

Most/all games I played on the ROG Ally have been open worlders so have gamepad functionality built in and so the buttons for the ROG work pretty much fine as xbox controller but I just started playing Pillars of Eternity 2 which I would like to map quite a few keys to buttons and hardly any of the keys are already mapped when I try and press a button. It will be mapped some random key like Escape or Return but many are not mapped at all.

Is there a built in program, or one I can download where I could map all keys of the ROG to keyboard keys? I would also like to be able to use those back button keys for something useful, which I haven’t been able to so far as they do not seem mapped to anything so far in any games I played.

So how to achieve this?

Any answer please.