It is mostly a hook for anyone to to register URL transformation function and for anyone (else) to have them applied. Since ServerWebExchange is available everywhere, I agree it can be moved. Alternatively if we did not provide this option at all, it would have to be a well-known request attribute which points to ServerWebExchange again.
I decide to rename the methods to transformUrl/addUrlTransformer, because rewrite would have resulted in addUrlRewriter, and I think the word "transformer" is nicer than "rewriter". I've used the add prefix (instead of register) to make it clearer that each
function is added in addition to the previous one.