The sorting hat was largely CGI. There seems to have also been a puppet hat, but it was operated as a hand-puppet (with the operator simply obstructed by the person wearing it or digitally painted out) and as far as I can tell, there was never an animatronic hat.
But the Hogwarts Sorting Hat was mainly a creation of CG crews. "We gave the animator first crack at designing it," says [Production designer Stuart] Craig. "It's really quite ingenious, the way that the eyes and mouth are just parts of its folds."
Entertainment Weekly: 23 Astounding Harry Potter Slides
We also have a post from Reddit User noramacsbicth (AKA Nora Koonce, daughter of Russell Koonce, Digital Effects Artist for the various potter films) in which she described the hat thusly;
I got to wear the ACTUAL sorting hat. Depressingly enough, it was just a plain brown hat shaped vaguely like the sorting hat- most of it was done completely with visual effects.
You can see an earlier version of the hand-puppet here. This one never made it into the film
As to the joints on the CGI model, it's probably instructive to look at the CGI puppet for Dobby (animated by the same studio that animated the hat). As you can see there are thousands of potential points of articulation rather than a singular skeleton inside the model. Each point can be deformed by the animators to give the effect of movement. There's no good reason to assume that they used a different technique for the hat.