This is a setting which gets saved between games in the prefs.ini file; as soon as you would define a specific group or different relations of a custom (#12) to X & Y & Z races, play a game with it and then, reload an all new setup while modifying these slots and their status -- the new values always override the previous set.
Take X-Worlds as an example;
X-Com_Magnetic_Apocalypsion are always declared at war with Sectoid_Aquatoid_Anthropod respectively and friendly with Interceptors_SHADO_Thunderbirds... assuming my game setup is done like this:
Human player = one of three different X-Coms
First opponent slot = any Aliens
ALL 2nd to 8th = anyone
Ninth opponent slot = choice of Friendlies above
My prefs.ini would always use this framework unless i change the number of active races during any further games. Or the slots definitions already there.
BUT, and this is really weird or interesting as you might say;
I could also do this...
Human player = Snakeman
First opponent slot = Thunderbirds
Ninth opponent slot = Magnetic
Then, the Magnetic would be friendly to Snakeman which is at war with the Thunderbirds!
As long as all slots are filled from game to games, the structure remains valid.
But this is all presumed on the fact you'd be using the current version #05-E way of installed files (39 customs continually available from (c:\my...).
In the upcoming #05-F, it will all change since i will be going for a multiple and highly variable Total-Conversion(
S) type of settings. Nothing would stop anyone from re-saving any individual races as custom#12, though; making the mod **extremely** versatile and configurable.