If the walkers have a getin waypoint on the lead vehicle of the transport group, and the transport group has a load waypoint, then it should work without further interference.
If the walkers are led by the player, and therefore can't use waypoints, then there are several ways you could do it. For example a radio trigger fired by the player "OK, we're all in, lets go" then the player can control things directly.
In general, if you just wanted the scripting solution it might be something like
("_x in lorry1" count units grp1) + ("_x in lorry2" count units grp1) == count units grp1
Syntax not guaranteed.