A cosmological pathway to testable leptogenesis