There are two methods.
1. By entering the lottery in Jubilife TV and winning 98 times which would be incredibly lucky
2. Cheat, this is obviously frowned upon and I don't recommend you cheat as it just shows bad sportsmanship.
It is possible to catch legendaries with other Pokeballs its just more difficult there is no way to get the regular pokeball to do any better at its capture rate without cheating. So save the Masterball for Heatran or another Post-Game Legendary. Use Ultraballs on Dialga, the Lake Guardians, Rotom and Cresselia.