There are identifiers to each model, certainly, but of course there are different things that differentiate between models. The GP38, 39, 40, 49, 50, 59 and 60 are all essentially the same body, but the GP38 will have two radiator fans while the GP40 has three. The GP38 is normally aspirated and has two small exhaust stacks, while the GP39 (while being otherwise identical) is essentially a turbocharged GP38 and the only major spotting difference is that it has one large exhaust stack instead of the smaller two. It's just little things like that. The SD50 and SD60 are virtually indistinguishable from each other externally, with the only real difference being that the SD60 had a new 710-series engine to replace the troubled late-645 series that plagued the SD50. An SD45 has flared radiators, while the SD45-2 has straight radiators. On and on. Little details.
There are also things like the GP33ECO, which looks like a GP60 with an SD70 flared radiator assembly, or the SD26, which is an SD24 rebuild that moved the rooftop "torpedo tube" air tanks to a different location.
Going over to GE, the major spotting difference between the AC4400 and the ES44AC is the thickness and size of the radiator assembly, with most of the rest of the body being very similar.
These are just a few examples of what you have to look for. There's not too many locomotives that just scream "I'M THIS MODEL" at a glance, because most locomotives are the result of progressive design changes rather than being something unique. The GP30 with its unique roofline and the SD24/26 with its rooftop air tanks are two examples of the more unique critters, but for most models you'll have to just learn which specific external details make them different from the others. And for some, like the SD50/60, you just have to look at what's printed on the cab or ask
If you're interested in the history of the locomotives as well as how to spot the differences, I'd also recommend "GE and EMD Locomotives" by Brian Solomon. It basically goes through the manufacturing history of all the GE and EMD locomotives, explains the differences in them as one model progresses to the next, and has lots of pictures. It's helpful not just for spotting little differences, but also giving you an understanding of why those changes were made and what they meant. To me it was much easier to remember and understand the differences in the locomotive models once I'd actually read how they came about and wasn't just trying to memorize a checklist of details.