That's what the judicial system is for.
However, I've always thought that judicial system is a mean to check the legislative branch (rather than executive). The reasons being that judicial system has no mean to enforce/ prevent wrong doing (legislative can cut funding), and they also have no way to proactive prevent any wrong doings from happening (you can't do investigation, and anything that reaches the court necessitates a lawsuit).