You're confusing yourself with all of the analogies. The bottom line is horsepower is measured at the crank flange. If it doesn't make it to that point, you didn't make it. Everything that happens upstream is considered 'losses'. You have to draw the line somewhere, and those SAE folks draw it at the crank flange.
Otherwise, we could measure the amount of gasoline being burned, equate that to horsepower, and claim everything not coming out of the crank is real horsepower that we just aren't letting get out. Your average 300HP engine? It's really making 1200HP, but you're wasting a lot of it in exhaust heat and friction.
The Japanese electric motor makers are very sneaky this way...they measure efficiency by JIC standards, and their published motor data shows very high efficiency. The problem is, JIC standards don't include a lot of losses that the rest of the world does, so their numbers are artificially inflated and their motors are actually no better.