It is works anywhere but it is easier to remember if you add it to an existing Hydra.
Here is the code.
("H" (lambda () (interactive) (hack-local-variables) (message "Local variables hacked"))) ("N" normal-mode)
Here is the documentation.
_H_ hack-local-variables (see also normal-mode) _N_ normal-mode (see also hack-local-variables)