My gelding (Chevy) used to get bad separation anxiety when I took my other riding horse out. I tried to give him hay/treats to occupy him, but nothing worked. He would run up & down the fence line calling & screaming. And would be an absolute hot mess when I got back. My riding horse didn't care, so I still had a nice ride.
What I started doing was taking Chevy out of the paddock. He is not sound for riding, but I would take him out more by himself and hand walk him around the yard. I could tell there was a certain distance from his friend that he would start to panic. I wouldn't ask anything of him, but just let him graze on the nice, green grass....and eventually get him walking further and further away.
It progressed to longer hand walks down the road with a bit of ground work mixed in.
It ended up working, as in the future when I would leave him by himself he wouldn't get nearly as worked up b/c he realized his friend would return. Plus, I'd done some one on one work with him, so he kind of learned that being alone wasn't as bad.
I also eventually ended up buying a third horse :)