On the dissection of degenerate cosmologies with machine learning