Lannes’ $T$-functor and the cohomology of BG