3 big questions.
"Is tribalism and people separating themselves into “us” and “them” groups, a learned or genetic trait? Can it be overcome? If so, how? "
https://www.quora.com/Is-tribalism-and-people-separating-themselves-into-us-and-them-groups-a-learned-or-genetic-trait-Can-it-be-overcome
"learned or genetic trait?" - I do not know for sure, but it may be similar to the 'nature or nurture' debate ie not proven.
I reckon tribalism can be overcome as I largely believe we are taught it directly - by school,family, peers, Media, and indirectly with sheer exposure to it. I think we are ALL conditioned from birth, before we develop the skills to avoid such programming.
This is thee major problem involving humanity. We may be able to remove some or most of this conditioning/indoctrination but I doubt ALL of it.
"How does creating ' in' groups (e.g. race, religion, sport team fans, people with a hobby, etc.) help and hurt society?"
That's a biggie ... not sure what you mean by 'in' groups... if you mean in vogue, that is an fad most times, aspirations to elitist and can be predominantly 'monkey see monkey do', but not always. Religion has a mixed record, sports team fans largely harmless distractions, people with a hobby usually fine (unless an antisocial hobby- crime,violence etc. - race can again be faddy, perfectly harmless tribal company, or dangerous gatherings.
If a person can discern and break away the conditioning we all have, all these 4 groups can be harmless and enjoyable .