Kac–Wakimoto characters and almost holomorphic modular forms