Learning in dynamical systems with guarantees: from system identification to safety verification and fast adaptation