https://www.mediawiki.org/wiki/Manual:HTML_templates
Native starting from 1.25, so perhaps a little bit too early to use for SF, since I seem to remember they like their backwards compatibility.
However. much better than cloned hidden divs as used by:
https://github.com/wikimedia/mediawiki-extensions-SemanticForms/blob/5c90c4767e3924b53cf2eae50faddd8a01da88d2/specials/SF_CreateTemplate.php#L96
The mobile team did have templates earlier, possibly that could be used for older MW versions through stubs.