In German we have a word more specific, I'd argue: "Fremdschämen". It means literally "foreign-shame". It is the feeling of exactly that, seeing someone doing something embarrassing, and feeling ashamed for them in their perspective. Which I would say is a form of empathy.