I was looking for this as well. I believe the book is called Missing Magic by Emma Laybourn. They are flying sheep not pigs. It was published in 2012, which is two years off from your date, but otherwise matches.
![Missing Magic - book cover - Flying sheep circled](https://cdn.statically.io/img/i.sstatic.net/RBLfG.png)
Thanks to his influential uncle Kelver, Ned’s gotten into an elite new school. But there’s a problem—everyone there can do magic. And Ned? Not a lick. Amidst whispers of the terrifying Necromancers (rumored to be kidnapping unsuspecting kids!), Ned struggles to adjust to his new situation, avoid making enemies, and jump-start his magic skills, all with very little luck. Then, just as he’s getting accustomed to having his hair turned into snakes and his books into bricks, the Necromancers strike! Ned and his classmates are kidnapped. But without magic, how can he possibly help them escape? Things can’t get any worse—until they do.
TV Tropes has an entry on The Magic Goes Away that mentions the uncle as the person who stole Kelver's magic:
In the book Missing Magic, a young boy has to deal with being the only one without magic powers. When his uncle turns out to have been the Big Bad (after taking his powers and killing his father) his uncle uses the same spell and removes everyone's magic by accident. The boy comes to realize that eventually magic will return and someone will pioneer its discovery, long after everyone forgets it existed and moves on.