But notice that punishment only serves its proper deterrent purpose when the criminal knows the transgression for which he is punished, and which player or coalition is taking credit for the punishment.
Not necessarily. For evolution to reduce the number of crimes, it is only necessary that punishment causally correlate with crimes.
When dealing with other optimization processes, e.g., human brains it is only necessary for the person to notice that crime pays less without realizing why. It's not even necessary for the person to be aware that he's noticed that, simply that for the value the person assigns to how much crime pays to be less then it would be if you hadn't acted.
I think you are right that evolution is not fussy about whether the punished agent understands the causality just so long as there is causation both from genes to crimes and from genes to punishment. That second causation (genes to punishment) may be through the causal intermediary of the crime, though it doesn't have to be.
Evolution is a kind of learning, but it isn't the organism that learns - it is the species. And, of course, evolution can learn even if punishment falls on the offspring [Edit: was "can direct the punishment to offspring"],...
Here's an edited version of a puzzle from the book "Chuck Klosterman four" by Chuck Klosterman.
When should you punish someone for a crime they will commit in the future? Discuss.