If I'm a police officer in the United States and my partner is restraining a suspect with an excessive or otherwise out-of-protocol use of force, what am I legally allowed to do to stop him?
As mentioned in a comment by @Dancrumb, the exact policies of each local police department will be different, and there are thousands of them. There is a relevant requirement at the Federal level according the Department of Justice, but it is not clear to me to what extent this applies to peers and not just supervisors:
An officer who purposefully allows a fellow officer to violate a victim's Constitutional rights may be prosecuted for failure to intervene to stop the Constitutional violation. To prosecute such an officer, the government must show that the defendant officer was aware of the Constitutional violation, had an opportunity to intervene, and chose not to do so. This charge is often appropriate for supervisory officers who observe uses of excessive force without stopping them, or who actively encourage uses of excessive force but do not directly participate in them.
Protocols mainly refer to formal proceedings (reporting to superiors, complying with internal investigations, etc.). They are useful when dealing with problematic behavior after-the-fact, but are not generally useful or used in the field. Most situations in the field are handled personally and informally, between officers. In most districts officers receive training in techniques and tactics, which would include safety training; in many districts officers receive training in how to manage and work with the general public. But I've never heard that any police force explicitly trains or instructs its officers to restrain other officers who are behaving badly. On the contrary, police culture generally demands that officers back each other up, and expects that officers will show reasonable common sense and circumspection. An officer who is behaving badly is most likely to be pulled aside by a fellow officer until he regains his focus, without any protocol or official action being invoked.
Unfortunately, this kind of informal practice isn't always effective, and is particularly ineffective when there are systematic biases in the department. If most of the officers in a department are convinced that certain types of people require more forceful control, then excessive force against these people will be normalized: officers will be more likely to see excessive force in such cases as acceptable and appropriate, and thus will be less likely to intervene if it occurs. This is the heart of racial biases in policing in the US. In many places police carry a deep-seated belief that non-whites are inherently more suspicious, more prone to violence, less rational, and generally more of a threat to themselves and the general public. Whether or not this rises to a level of overt racism, it colors their thinking such that they are more likely to pursue and/or stop people of color, and more likely to apply harsher methods of physical control when confronting them. The result is a statistically predictable increase in disproportionate force used against people of color.