Returns an [[Encoder[U]] by applying a function that maps a U to an T, before encoding as an T using this encoder.