Rather than switching to "main" and pull it, you can just stay in "feature" and do a fetch followed by "rebase origin/main". Then pull "main" before you merge the feature.
I'd also use "merge --no-ff" to force an empty commit that visualizes where a feature begins and ends.
If you always rebase the branch, the commits can be applied directly.