Learning low-dimensional state embeddings and metastable clusters from time series data