You can and should block your keyboard app's access to the network using a firewall. However, this will require root access and I've seen people jump at this point to say you absolutely should not have root access to your own phone, which I find pretty ridiculous and unacceptable.
> Share snippets: Automatically share snippets of what and how you type in Google apps to improve Gboard [enabled by default]