Here’s a special preview action that should help.
If I’ve got this right, it should take your draft content, find the headings, add in the appropriately formatted anchor elements (leaving your original draft content untouched), then pass it on (via a custom template tag) to a preview step. It worked fine for a couple of quick test cases I tried, but it has not been extensively tested.
I’ve seen the format used on GitHub, but I think it’s tied into the wiki support rather than it being in the GitHub Markdown spec.; but I’ve not dug into it deeply. But if you are passing the draft content on to something that supports the auto-generation of anchored links for headings, then this preview should help you check it, or simply allow you to use it as linked without leaving the app.
Hope that helps.