I'm not a 100% sure how best to do this as this isn't something I've ever tried
\libraries\src\Document\HtmlDocument.php is the core file where it refers to the location
Are you doing this for security reasons?
If so I'd instead purchase an extension like admin tools and lock down the ability to change template settings using this extension
Cheers
Paul