I definitely recommend you get a Pokemon that can use some paralysis moves, such as thunder wave and stun spore.
Another good alternative would be to put the Pokemon to sleep as it gives you time to bring down your lengendary's health and it cant do anything to you and helps you stay defensive in a way. A good move I recommend would be spore. The Paras line, Shroomish, and Foongus line can learn this move and it can be really good for your team in catching these legends.
Make sure you also have a strong defensive type and a semi strong offensive type.
Maybe also if you find your legend's health going down to low, Audino with Heal Pulse works well in your favor if you'd like to go a toxic, poison, or burn approach. Best of luck :)