To point out what might be obvious: this doesn't transfer _just_ the stars. It simply swaps two repos, which means the issue tracker, pull requests, watchers, forks, projects, etc., also get transferred with the stars.
It's not possible to transfer just the stars while maintaining all the things that you can't directly control.
I did something similar when I decided to change my github username without changing all the import paths of Go packages I had. I changed the username, made an organization with the same name as my previous username, then moved all my repos to the organization. So the URLs of all the repos stayed unchanged. [1]
When you rename yourself on GitHub, their Help says they put in redirects for all of your repositories (that last until such time as someone else claims your old name and creates a new repository with the same name as one of your old repositories, as this new repository supersedes the redirect). So squatting on your old name is a good idea to protect the repository URLs, but actually transferring your repositories to the squatted name seems unnecessary.
Yeah, I was aware of the redirects, they're very helpful! It would've been okay to rely on redirects on a temporary basis if my long-term plan was to move everything to the new username. But I wanted the repos to keep their old URL permanently, so that's why I moved them.
It's not possible to transfer just the stars while maintaining all the things that you can't directly control.
I did something similar when I decided to change my github username without changing all the import paths of Go packages I had. I changed the username, made an organization with the same name as my previous username, then moved all my repos to the organization. So the URLs of all the repos stayed unchanged. [1]
[1] https://twitter.com/dmitshur/status/1021266582834634752