Does that prevent Congress from passing laws criminalizing ongoing behavior by corporations, or just from prosecuting acts from before the law was passed?
Not a lawyer answer: the latter. Note, though, that a law criminalizing behavior specific to one person or corporation could be considered a bill of attainder, which is prohibited by the same clauses in the constitution.