违法 (illegal, breaking the law) vs 犯罪 (fànzuì, to commit a crime). 违法 is broader — it includes minor infractions. 犯罪 specifically means criminal offenses.
usage
Common: 违法行为 (illegal conduct), 违法犯罪 (law-breaking and crime), 违法成本 (cost of breaking the law).