The GPS is sporadically enabled on my phone without my consent or even a notification. I have to keep an eye on it and turn it off when I notice it's on. Is there a "global" setting I can use to prevent this or at least ensure I get a notification when it's about to be enabled?
automation as suggested in comment seems to come close to what OP wants.
Your macro would look like this
- Macro : GPS on Alert (name of macro )
Trigger: GPS enabled/disabled →*GPS enabled *
Display Notification → Enter the desired text. I suggest you choose hour, minute and second to pinpoint the exact time
Speak text - enter the desired text
Constraints: None ( Macro runs always )
This will not tell you when it is about to be enabled but tells you after it is enabled.
Once you have the time stamp, use an app or other methods suggested in logging & logcat to try and pinpoint the app causing it (read their tag wiki's by clicking on learn more). Disable or uninstall such app(s)