When I was a kid, around 2008, I read a trilogy of fantasy novels that I've forgotten the name of.
They're about a boy who lives on an island. His father, while doesn't hate him, is disappointed in the boy compared to his brother, who seems to be the very paragon of their order. Their order is comprised of magic-using monks/wizards (don't remember the actual name they used). However, the boy finds his brother being tortured by his own people in a secret room. They are trying to wipe his memory so he forgets magic, exiling him afterwards. The boy is outraged and escapes the island.
Across the island is an empire/kingdom which apparently is totalitarian of some sort. The boy and maybe a few friends(?) sneak into one of the cities for some reason while the citizens are celebrating a mandatory event (I think). Somewhere down the road, it turns out the brother actually agreed to the mind wipe in order to complete a mission given to him by the monks. I feel like a dog is involved but I'm not sure.
It's been years since I've read the books so I don't remember anything else related to the story. I know it's teen fiction and the author is an atheist.