I would suggest reading Lincoln's Code by John Fabian Witt. I can't give a completely accurate summary of his arguments from memory, but he talks about the evolution of the law of war in the US, part of which addresses the development of the idea of the war crime. He argues that precursors to the modern concept appeared in the Mexican-American War and in the Civil War, before being codified between the Philippine War and WWI.
I might be wrong though, so I would recommend checking out the book yourself. It's pretty interesting.