I learned this on my own and I usually do a double-right click with cavalry on an infantry (if they have to pass the army line to get to open space) walk when in a close position (not just at charging range) or stop if the formation is cranky and BOOM! charge, melee for 2 seconds and retreat back to oringinal places and now for guard flanking duties and flanking.