Explain how the common law can violate the principle of legality?:
It really can't in a common law jurisdiction.

The concept of common law is that valid decisions/interpretations by courts are binding authority on lower courts. So, it can't be illegal for courts to do what they are designed to do.

Civil law systems (such as France, or Lousisana) work differently, and there the court holdinds are not binding in the same way as under common law.