Remember Me
See this wiki page and the videos linked on it.
https://github.com/retropie/RetroPie-Setup/wiki/RetroArch-Configuration
Each console page on the wiki that has non libretro emulators also shows emulator specific controller configurations.