You can add your fork of needed repos as a separate remote. example.
When you repo sync, the GrapheneOS repos will be checked out again.
repo sync tries to automatically rebase the current branch by default when syncing, which often doesn't work.
To prevent that, you need to use the --detach option which will checkout the manifest commit without touching the current local branch.
You can switch the branch in needed repos to your fork again after sync.
You can then rebase if needed.
cd ~/grapheneos-15
cd frameworks/base
git remote add origin https://github.com/USERNAME/platform_frameworks_base/
git fetch origin