Was the formation of the Seven Commandments done in a democratic way in the book Animal Farm?
No, the formation of the commandments was created by the pigs alone. They insisted this was done because of their great learning throughout their opportunity to learn, read and study. Because the pigs could comprehend and think, it was best to position them to make the commandments, however, that demonstrates that instead of democracy which listens to the voice of the people, this was rule by a select few, a self-appointed few. Although they made it appear different than a dictatorship, the point of the entire novella begins to unfold by this one very simple task. Creation of the Seven Commandments was not democratic. A good quote to use in demonstrating this answer is this from chapter 2:
They explained that by their studies of the past three months the pigs had succeeded in reducing the principles of Animalism to Seven Commandments. These Seven Commandments would now be inscribed on the wall; they would form an unalterable law by which all the animals on Animal Farm must live for ever after.