In more ways than just this, AoE2 is rather similar to Chess. In many cases, it just comes down to intuition - the whole "when you know, you know" sort of thing.
The most clear-cut indicator is probably tech level. If you're in a prolonged feudal/castle age war with an opponent who has the upper hand and they reach the next age at a point where you're not even close to clicking up, it's probably time to resign.
Certain units, particularly capable raiders, also often force resigns. If the opponent is flooding EEW, huskarls, or paladins into your economy and you don't have the forces to defend your villagers or the fortifications to hide them, it's usually over.
We've all played (and probably been, as well) the guy who hides his last villager in a transport ship in the corner and refuses to resign. This can be annoying, and is certainly deplorable etiquette, but I consider it far less of an issue in terms of playing aptitude than resigning too early. Far too many players hit the panic button and resign when they start getting raided or lose a defensive castle to the opponent's fast imperial or something, even when victory is still a distinct possibility. I've seen Arena games, for example, where a player is pushed back into a 10x20 pocket of the map and manages to parry the opponent's aggression before taking the victory.
The exception to the above is perhaps regicide games, where a king snipe is always theoretically possible no matter how far behind you are. Even this is only true to a point, however. Most experienced players in a losing situation on regicide will resign after the first failed desperate king snipe attempt.
Team games, as you mention, are a completely different ball game. If the team as a whole knows that defeat is imminent, then the players resign as a group. If an individual player is getting trounced but the team is still very much in the game, they just have to suck it up, reboom in a corner with their remaining villagers, and do what they can to help the team.