Pseudo-invariants theory and real phases for systems with non-Hermitian time-dependent Hamiltonians