At the moment, default transformers for certain fields are hard coded in a private variable so it's impossible to modify it:
https://github.com/compose-spec/compose-go/blob/e508c724a35f6b21d90b4282baa776916f8a55d0/transform/canonical.go#L25-L54
Fork and make it a public variable or work out a better way to make it possible to customise the default behavior. Work with maintainers to change this in upstream.
We need to be able to modify services.*.ports to accept additional protocols such as http and https and a hostname in published field. At the moment, a custom x-ports is used instead but it would be great to be able to slightly extend the existing spec.