Invariants for time-dependent potentials: Use of self-similar techniques