Generalized trace distance approach to quantum non-Markovianity and detection of initial correlations