I know this is an old question, but it’s something I was searching myself so I will post the info I gathered here:
According to some of the links that Zylann posted in his answer, which shows you how to compile Godot for multiple systems, there are sections which point out how to create export templates for that system.
I haven’t done it personally myself, but it appears that the way an export template is created is simply by compiling Godot from source on that system with the “tools=no,” flag set, which compiles the engine without the editor.
This seems to be a slightly different process on every platform, but it looks like in every case you need to start by building Godot on that platform, then dig through the existing build tools and see what needs to be changed and added to build for your system.