When the Oak loses it's connection, if you have the board profile set as 'Pin 1 Safe Mode - Default', when the oak has trouble with it's wifi for a set time period it will drop back into config / safe mode (as indicated by a triple blink pattern). If you want to fix that, choose the 'Pin 1 Safe Mode - Manual Config Only' board option.
IIRC, it is not that the wireless connection is lost that is the trigger, but that it can't talk to particle... (ie. "Tt will also boot to a safe mode if there is a timeout (do to a while loop that doesn't call Particle.process()) or a exception (memory overflow, etc)", so another other option may be to use the
SYSTEM_MODE() API calls to instruct the Oak that you want to manage either the particle connection manually in code, which should prevent the automatic safe mode due to inability to talk to particle...