Generalized linear spectral statistics of high-dimensional sample covariance matrices and its applications