Where you execute it is fully up to you. To store vehicle cargo you could have a global array that contains nested arrays of [vehicleid,ace_vehicle_cargo]. Maybe you store each entry to thr global array everytime a player exits a vehicle.
To save this variable, you could run ["myAwesomeVehicleData", myglobalarray] call alive_fnc_setData.
To load the data after a restart, you could have a check in the server's init sqf that checks if ["myAwesomeVehicleData] call alive_fnc_setData
Returns a non-nil variable and if so, start restoring the data.
The difficult part is keeping track of each vehicle since their object id's might change over restart -- I believe sys_data keeps a persistent ID for all vehicles but that's beyond my exploration.
Sucky explanation but hopefully it spurs some inspiration.
And just a general explanation for anyone who's never used these functions before.
Think of _fnc_setdata as
missionNamespace setVariable ["key", var]
And _fnc_getdata as
missionNamespace getVariable "key"
Except each key - value pair can be persisted