Hysteresis in phase transformations