You can make the CEP persist it's state by enabling snapshots. The documentation can be found here. But note that this will persist the "entire state" of the CEP "periodically" (configurable in minutes). Since this is done only periodically, you may lose the latest few events that arrived after the last snapshot operation. If you want cep to recover after a crash, this is the easiest option.
Apart from this, there's no other way to make a pre-defined window persistent. But if you want, you can write a your own custom time window (documentation) that will do the persistence and plug it to CEP.
You can also use event tables instead. When you use event tables, you can make sure that all arrived events are persisted. (but one disadvantage of this approach is this can be a performance hit compared to windows + snapshots approach).