Spectral embedding for dynamic networks with stability guarantees