For nature, there's two methods:
- If catching a Pokemon, if you lead with a Pokemon that has the ability Synchronize, there is a 50% chance the Synchronizer will pass its nature onto any wild Pokemon you encounter. This includes legendaries.
- If breeding a Pokemon with Ditto, giving Ditto an Everstone hold item gives it a 50% chance to pass its nature onto any babies bred from it. If not using Ditto, stick the Everstone on the female Pokemon of the two to get the same effect.
For Hidden Power, there's two methods: RNG or luck. All I'll say regarding that is quite simply, pick your poison.