Welcome! To your questions:
1. There are a list of selected fleets and/or ships that you can iterate over, like this mainly:
Engine_AIW2.Instance.DoForSelected( SelectionCommandScope.AllPlanets, delegate ( GameEntity_Squad selected )
{
//do your stuff here; this is for every squad that is in a selected fleet, or is directly selected
return DelReturn.Continue;
} );
Bear in mind that this is NOT multiplayer-safe. So, aka, the selected units are considered a local UI element. You can look at selected units, but no direct touching. If you want to change things about a selected ship, then you'll need to send GameCommands to do the changes in a MP-safe way. Even in single-player, you'll potentially get strangeness with the background game threads if you don't use GameCommands.
Check out something like ToggleFRD_FromPlayer as one example of how to do something like change the Pursuit mode for a bunch of selected ships.
Also please note it is not possible to "select a fleet but then deselect part of the fleet." If the player has selected a fleet, that means the whole fleet. If the player has just directly selected units, then that means whatever they selected. But some folks do wind up doing "select fleet" and then trying to alt-click to remove a ship or two, which immediately reselects those ships because they're part of the selected fleet.
2. In what sense do you mean? A specific fleet during an actual game, or a prefab fleet design that can be used in many games? The former is code that is based around Fleet.Memebership being added to a fleet, and you can see that as the result of something like an ARS hack as one example. The latter is all xml-based and the starting fleets are a good example of how those work.
Cheers!
Chris