It is n=3 because the d-orbital is always minus 1 of whatever period it is. For instance, if the transition metal is in period 4 then it's n=3, if the transition metal is period 5 then it's n=4.
The electron config of Co is [Ar] 3d7 4s2...so if you lose valence electrons, you would lose them from the 4s orbital. The outermost electrons are now in the d orbital, which is n=3.