We have an outdoor electrical outlet w/ two knockouts. I was going to add the doorbell transformer in there but I couldn't find out if it is code to have the transformer in a dry outdoor place. It is unlikely to get any rain or snow unless there is a really severe storm and knocks over furniture.
A basic Google search: "can a doorbell transformer be outdoor" yields this from the home depot, really? I've never seen doorbell transformers outside.
"Doorbell transformers are usually located outside the home along the siding or on a wall in the garage. They may also be fixed to a wall in the basement or closet near the front door or entryway. If you don't see it in any of these places, check the walls in the attic. It may be tucked behind the insulation."
Update
thank you for your responses. I didn't see anything in the transformer's documentation about outdoor use.
In the before screenshot, I mounted the transformer for a couple of weeks to at least have a doorbell working. It rained a couple of times, and there was no moisture on it. Still, it looked terrible so I went ahead and used the LiquidTite PVC conduit to feed it under the deck. The transformer I moved to a weatherproof box under the deck, 2 gang. Now it is secure and away from the elements. I even power washed around the setup a few weeks after and no issues.