See the git-filter-repo repo for installation instructions.
Create a new empty repo on github.com and note the repo URL.
First create a scratch directory to work in to avoid touching an existing repo.
mkdir tmp_migration_dir
Next create a fresh clone of your existing repo with the directory you want to move.
cd tmp_migration_dir
gh repo clone old_repo_org/old_repo_name
Filter the repo to extract the subdirectory you want to move.
cd old_repo_name
git filter-repo --subdirectory-filter path/to/subdirectory/
Add a remote for your new repo and push to it.
git remote add origin https://github.com/new_repo_org/new_repo_name.git
git push -u origin master
Remove the temporary directory.
cd ../..
rmdir -Rf tmp_migration_dir