Code feasibility question
It's certainly possible, but not purely with anything the wiki software has. You'd need an external program written in a language such as Python (with the pywikibot module) that does the work for you.
To be clear, you could either use one of the dump files ([1]- I'm not sure which one specifically has category membership information) or the API. There's not really any way to do it live- you would have to run a bot periodically.
I see... If I understand correctly, the python bot would run from my machine.. I'm quite surprised to see that Lua or other module running server-side don't provide primitives for iterating through the content of a category or through the categories a page belongs to? Will look into that pywikibot, then. Thank you!