It is stored in
preferences.txt in your Arduino data folder.
You can find more about that file, including where to find it, here.
Some of the keys you may be interested in are:
However maybe for your workflow the Arduino IDE isn’t the best tool for the job. You may consider
arduino-builder, which is the back-end that the Arduino IDE uses to do the actual compiling, or maybe another IDE entirely, such as PlatformIO or UECIDE.