You can't put an RTC_DATA_ATTR qualified variable inside a class because the class is stored in normal RAM. The RTC_DATA_ATTR qualified variable is, by definition, stored in RTC RAM.
The definition of RTC_DATA_ATTR includes a section attribute (__attribute__((section(".rtc.data")))) that tells the compiler where abouts in memory the variable should be ...
I think some explanation about the different allocation schemes could be
Global variables, as well as static locals and static class members,
are allocated at build time, by the linker, typically in the .data or
.bss section of the program.
Local variables are allocated at run time in the stack. Typically the
compiler issues some instructions to ...