The EU is not just a commercial organization. It is an actual political union. The English-speaking press tends to hate mentioning this, but it is the truth. The treaty of Lisbon says that the goal of the European Union is to create an "ever closer" union between the member states. Every member state signed up for this.
> I would've thought that this was outside the scope of the EU
Few things are outside the scope of the EU.
> was power constitutionally transferred to the EU parliament at some point?
It is a very complex topic, but the short answer is "yes". Member states agree to translate EU parliament decisions into national law at their own time. They have the ability to veto any initiative through other channels.
> If a member nation refused to obey an EU law (or whatever it is), what sort of punishment or sanction could be applied to them?
This things are usually dealt with through diplomacy. There is a lot of tolerance. Often nothing happens but many types of sanctions (usually economical) are possible.