Ultimately, there's four triggers missing from this to make it work as a single generic trigger. Setting attack range, setting attack model, setting attack damage type and setting valid targets for an attack. Of these, it's excusable to leave out the last two, should this only apply to units that have a single type of valid target and type of damage, and setting attack model can be a non-issue if we're discussing only non-projectile attacks. We have a condition for a unit being loaded into a transport, the actions accept "transporting unit" as the unit that has been loaded into, and we can set the base damage, dice number, dice size and attack interval from existing triggers, allowing the raw damage characteristics to be imitated directly.
No idea on how to handle a non-unique unit workaround for range, though if you only have one of the unit, you can use the Long Rifle upgrade to set the range as desired under if/then clauses checking the type of the unit loaded in, but this solution then requires a specific condition for each valid-to-load unit. For attack speed, you can increment a hidden attack speed increase ability for the unit in question.
Undoing the effect is also rendered a bit convoluted, as there isn't a trigger for unloading, and trying to use the unload ability as the trigger doesn't work when you click the transported unit out, so you have to use a hashtable or unit group or something to store the number of loaded units and draw that number for the effect. And it gets a lot more complicated when you're trying to set it up for more than one unit type at a time, both because there's only two slots for attacks and because you have to then have the game decide how to apply them to those two slots, unless you've narrowed down to just two units to begin with. At which point you should just have two Burrow abilities.
Unless the vehicle has attacks it uses when it isn't loaded, or some other property that makes Burrow's simple attack enabling a non-applicable solution.
There's also the solution of using Pheonix Fire abilities that give the statistics of the loaded unit attacks, necessitating an ability per valid unit and specific triggers. And you'll still need triggers tracking how many of a unit are loaded, to set the cooldown of the ability so that attack upgrades can be done with the ability levels. Or you can use triggers to apply the upgrade-based damage appropriately, which will be necessary to apply the variable damage of attacks anyways (and have them deal non-Spell damage). Regardless of how you do it, it isn't straightforward or generic, unless you go for JASS to do it a lot more manually.