Leptogenesis with a dynamical seesaw scale