Steve Gibson wrote a small utility that does this for you called Never10. Now granted, GWX Control Panel (GCP) also makes the same registry settings, but GCP also wants to install a background service to monitor changes, and while there's no reason to suppose there's anything nefarious about GCP, but the guy who wrote it doesn't have any street cred. GCP also doesn't check for the necessary update that makes the registry settings work.
I trust Gibson, and his app does not stay resident. It doesn't need to be installed. It's just a standalone EXE that checks for the update that's required (and if it's not installed it gives you a link to download it from Microsoft) and makes the registry changes and closes itself.
https://www.grc.com/never10.htm
In July of 2015, responding to the significant user backlash, Microsoft added features to its Windows Update facility which allow it to be configured, on a machine-by-machine basis, to not forcibly upgrade qualifying Windows 7 and 8.1 operating systems to Windows 10. However, Microsoft did not make this configuration simple. It requires the use of the group polity editor (which is not present in some qualifying systems) and/or the system registry.
The elegance of this “Never 10” utility, is that it does not
install ANY software of its own. It simply and quickly
performs the required system editing for its user.
If the system being configured has a version of Windows Update which is older than the required July 2015 release, this utility will notify its user (see the sample display screens above) and will offer to download and install the required update to Windows Update so that Windows can be configured not to upgrade itself to Windows 10.
Since this utility simply updates and/or configures the system to prevent or allow OS upgrading, it may be deleted after it has configured the system appropriately.
Using this utility, inexperienced users will be able to easily use Never10 themselves, while advanced users will likely appreciate that fact that no additional software is installed and will be able to refer friends and family, whom they support, to this easy-to-use utility.