Flux train! no longer works

I have a neural network with two parts: an encoder and the main network. Due to recent changes in the Flux.jl API, my code no longer works. I want to keep some of the weights of the main network and train them alongside the encoder. How do I do this in the newer version of Flux.jl? Do I have to pass two networks as the model into loss(model, x, y)?

When I create a Chain model, I encounter a Zygote error. The old Flux.train! no longer works. How should I train my network now?