Open Build - Select Compiler and press the button Edit Configuration. If you want packing the generated EXE with UPX only for the current project and not for all projects using this compiler configuration, you should press the button Make Configuration Local (Save in Project Directory).
Now scroll down to section [Build]. You should see there a Cmd0= command which builds the EXE. Insert below the command
Cmd1=path to upx.exe\upx.exe --best $T
You can use any upx parameter you want like --best. $T references the generated EXE (usually with a relative path to project directory). If the path to upx.exe contains a space character, it is better to use
Cmd1=""path to upx.exe\upx.exe" --best $T"
Please note that UPX is now always executed even if the build process failed because of a mistake in one of the source code files, but the target EXE is still available from a previous successful build.