Replacing the transformer may not be necessary, but you definitely want a Chime Controller if you have a mechanical chime and want to use that with Duo Cam Doorbell. See discussion in these topics:
At least part of the answer is going to depend on the origin of the unwanted noise, because you’ve indicated two sources:
If it really is the transformer, then that might be worth replacing. If the hum is coming from the chime box (i.e., if you have a traditional mechanical ding-dong! chime and that’s making a hum with the Duo Cam Doorbell installed), then I’m guessing you didn’t get a Chime Controller to put in there, so you’re having some of the issues described in the other topics I linked above.