In the Sakurai book "Modern quantum mechanics" (pg. 263) an operator $S$ is said to be invariant under a unitary transformation $T$ if:
$$T^\dagger S T = S.$$
Where that definition come from?
My guess is that it comes from the similarity transformation of matrix in liner algebra:
$$M^{\prime}=T^{-1} M T.$$
So if $M= T^{-1}M T $ then I know that the matrix doesn't change when I change the basis of the vector space. If $T$ is unitary then $T^{-1} = T^{\dagger}$