Now. If you want to keep or change settings in YouTube. add youtube.com to the white-list. In other-words, add YouTube website cookies from being deleted, and setting will stay there.
Here's something a bit more exhaustive https://www.neowin.net/forum/topic/948016-guide-firefox-keep-cookies-for-specific-websites/
for firefox i use "youtube high definition" and/or "magic actions for youtube" or "turn off the lights" as a light version of magic actions. cookies are not saved after session, i dont care.