Persistent homology of complex networks for dynamic state detection in time series