Whenever possible, always take a friend of group of friends along to a popular surf break so that the local surfers or trouble-makers think twice before ganging up on you. However, do not feel scared or worried about going to the surf break alone if you cannot get anyone to go with you.
You need to understand that one of the most common reasons for localism is overcrowding. If the surf break already has a lot of people in the water, there is a strong likelihood that you would be considered an uninvited guest and therefore would most likely be asked or made to leave the premises so that the local have more space available to them.
You need to understand that nobody has a sole right on surf break. Surfing is a travelling sport and therefore there is no reason to restrict yourself to the waves close to your home. You are free to travel to other places and surf at the breaks there without feeling that you are violating the rights of locals. Keep in mind that you have as much right to surf at a given break as the person who lives close to it.
In order to become familiar with the locals, observe the surfers at the break. The ones who are taking up most of the waves and strutting around are most likely the locals and therefore someone you should watch out for.
Avoid the locals who are apparently egomaniacs and consequently trouble-makers. You do not want them on your case, which is why it is best to not do anything that will catch their attention. If they do approach you, do not react to whatever they say. Remain calm and logical instead of losing your cool.