@alexf It seems to work for me if I go into the Retroarch menu (hotkey+B), then the Controls menu, edit the controls, then Save Content Directory Remap file.

That creates the file /recalbox/share/system/.config/retroarch/config/remaps/mGBA/gba.rmp which is autoloaded whenever I start a game in the roms/gba/ directory.

According to the docs it's supposed to be possible to create an override file in roms/gba/.retroarch.cfg but I've never been able to get it to work.