On the second largest eigenvalue of the generalized distance matrix of graphs