I have a website running Magento with two domains sharing the same root and domain1 redirects to domain2.
What is the best way to tell Google that domain1 is the same as domain2 in Google Search Console ?
There is no need to tell Google that the two domains are the same in Search Console. If one of your domains redirects to the other, Google will figure out that the two domains are the same just by crawling them.
When Google finds redirecting URLs it will choose not to index the redirecting URL and instead forward PageRank to the other domain, possibly causing it to rank higher than it otherwise would. Even if you served the same content on both domains, Google would only choose one of them to index. It isn't possible to get both of the domains to rank simultaneously unless they have different content an them.
In general alternate domain names don't help SEO very much. Buying alternate domains can protect your brand from squatters and forward users that make spelling mistakes, but Google probably won't rank your main site higher for having them.
The one time that a redirecting domain helps SEO is when your site used to be on that domain name and you redirect the domain to retain PageRank from external links to your old domain name.