Do you need to generate a key at all?
Usually not. Google Workspace, Microsoft 365 and nearly every sending platform generate the key pair themselves and give you a DNS record to publish. Generate your own key only if you run your own mail server (Postfix with OpenDKIM, rspamd, Exim and similar).
How this generator works
The key pair is created in your browser with the Web Crypto API. The private key is never sent anywhere: it exists only on this page until you download it. Publish the TXT record at the name shown, install the private key on your mail server, and configure the server to sign with the same selector.
Use a new selector each time you rotate keys, for example one that includes the year and month. Keep the old record published for a week or so after switching, so mail already in transit still verifies.