You want the equivalent of the LaTeX exporter's ,----[ C-h v org-latex-prefer-user-labels RET ] | org-latex-prefer-user-labels is a variable defined in ‘ox-latex.el’. | Its value is t | Original value was nil | | You can customize this variable. | | | This variable was introduced, or its default value was changed, in | version 26.1 of Emacs. | | Documentation: | Use user-provided labels instead of internal ones when non-nil. | | [...] | | For headlines that do not define the CUSTOM_ID property or | elements without a NAME, Org will continue to use its default | labeling scheme to generate labels and resolve links into proper | references. `----
I don't think the HTML exporter has anything similar but it should be possible to implement... -- Eric S Fraga via Emacs 27.0.50, Org release_9.2.6-552-g8c5a78