The answers are correct but don’t mention how to sync code between the public repo and the fork.
Here is the full workflow
First, duplicate the repo (details here):
Create a new repo (let’s call it private-repo) via the Github UI. Then:
git clone --bare https://github.com/exampleuser/public-repo.git
git push --mirror https://github.com/yourname/private-repo.git