UE4 Engine defines many macros and some processing logic within the engine, such as WITH_ENGINE/WITH_EDITOR, etc. Some of these are defined by UBT through reading the configurations in *.target.cs files, and some logic is processed by reading configurations in *.Build.cs.
I have read some of the UBT code and extracted part of the configuration files (Target.cs/Build.cs) parameters and their mutual definitions with MACROs as a quick reference manual.
You can view the parameters in *.Target.cs here: UnrealBuildSystem/Targets
You can view the parameters in *.Build.cs here: UnrealBuildSystem/ModuleFiles
UE’s build system documentation: Build Tools