You can get those buttons by selecting the allied units. Just select a grav well that has allied units and you can select a group of allied units like you would your own fleet. Once selected you get three buttons.
*set ally to attack
*cancel order
*set ally to defend
Click ally attack and then pick the grav well you want them to attack or zoom in and select a specific target.