I find the AI reacts identically no matter how you lay out your forces, and so i use the exact same tactic for every battle. A long line of muskets, with an identical long line of muskets behind it, and more muskets to the right and left of the line but not on the flanks. The AI will engage your front line and send 1 or 2 units around to "flank" you, at which point you drag units from the second line out to deal with them and then put them back when they are dealt with.

If a front line unit takes lots of casualties, you withdraw them and bring up a full one.