From: https://www.reddit.com/r/MacOS/comments/jy5ry8/m1_macbook_air_keysshortcut_for_keyboard/
Create a new plist file in ~/Library/LaunchAgents
named com.local.KeyRemapping.plist
and add the code below. Save the file and reboot. F5 and F6 will now work as keyboard brightness up/down keys (after you log in for the first time after rebooting).