Transformation of a shoaling undular bore