To determine, whether RTC has been already initialized or not (e.g. to start/initialize the RTC at the first run of device or after backup battery change), RTC offers the INITS flag. It is a read-only bit of the RTC_ISR register in RTC v2, quite unnecessarily renamed/reorganized in RTC v3 as RTC_ICSR (e.g. in 'G0/'G4).
However, the INITS flag only indicates, that the year field in RTC_DR register is nonzero.
As user Alec Davis noted in this thread, if date (thus year) is not set during RTC initialization (e.g. if the user does not care about date), or if year 2100 is reached, INITS will incorrectly indicate, that RTC has not been initialized yet.
So, for this purpose, it is probably better to use the RTC_BDCR.RTCEN flag (or its equivalent RCC_CSR.RTCEN in 'L1/'L0).