Dimensionality reduction distills complex evolutionary relationships in seasonal influenza and SARS-CoV-2