Why do you think it is in the registry? VS has moved away from the registry for the most part because you can have multiple instances of VS installed at the same time and each instance is licensed separately. For example I have VS Pro (1 license) and VS Pro Preview (another license) and VS Community (yet another license). The registry key you pointed to only applies to things that are shared across all instances and that is becoming less and less.
At least for VS 2019 and VS 2022 for a MSDN subscription then the licensing is stored (at least) in the per-instance registry key under HKCU\Software\Microsoft\VisualStudio\##.#_???\Licenses
. Unfortunately there is no easy way to match the instance name to a specific install as it is a randomly generated number. The preferred approach to getting info about installed VS instances is to use vswhere which is the CLI that MS built to provide information about installed instances including their instance number and path. However vswhere
returns product information and licensing is per user so it won't tell you anything user specific as far as I'm aware. You'll ultimately have to enumerate the VS instances installed for the current user and try to find the encoded product key.