You cannot show Google one thing and users another. That is called cloaking which is against Google's webmaster guidelines. You may not:
- Redirect Googlebot to
https://example.com/course/
- Redirect users to
https://course.example/
In addition to having all your content on one domain for SEO you want to have all your content on one domain for branding. You want your users to remember more than the name of the course. You want them to remember that it was a course from your brand. This is particularly important because you have items for sale and you want users to remember where to buy them. If you ever create another course, you want users to jump at the chance to take it because they remember the high quality of the previous course they took from your brand.
Rather than a separate domain for the course, I would recommend putting it on a subdomain: https://course.example.com/
That will associate it with the brand in the URL while allowing your to adjust the hosting platform as needed. You would still need to brand the course with the same logo and color scheme and keep the shop and the course interlinked. Subdomains are not always great for SEO, but they are far better than separate domains, especially in terms of branding. See Do subdomains help/hurt SEO?
If you really do want the content on a separate domain you should just accept slightly worse SEO and worse branding. The SEO aspects are not going to be that much worse. The branding problems are worse than the SEO problems, in my opinion.
If you really want to go ahead and try to have different places for SEO and users, there are a couple technical tricks that might work. Google allows:
- The same content available on both URLs
- Canonical tags to tell Google which URL to index
- Redirects to the non-canonical version for users that are not from Google search
So you could try putting the content in both places and putting canonical tags on it such that Google indexes it on the subdirectory. You would have to have all links from the store point to the canonical version (the subdirectory). The subdirectory would have to link to itself.
However, the separate site could also link to itself, so that if a user found themselves there, they would stay there. The canonical tags on the separate domain would point Googlebot to the subdirectory version.
The trick would be getting users to the separate domain. Any users that found your subdirectory from Google would have to see the content there to avoid cloaking. However, you could tell schools just to use the separate course URL, and maybe that would be good enough for your purposes. You could also redirect users (but not bots) that were not referred from a search engine. You could redirect based on the referrer header or you could redirect logged in users.