If you have a lot of task branches, then the best I can think of is to temporarily octopus merge them with Dev into a temp branch and then rebase temp onto master with --preserve-merges. Then reset the branch labels to the proper places.
$ git checkout -b temp Dev && git merge task1 task2
$ git rebase master --preserve-merges
$ git checkout Dev && git reset --hard temp^
$ git checkout task1 && git reset --hard temp^2
$ git checkout task2 && git reset --hard temp^3
$ git branch -D temp
It's still a lot of commands, but:
Since the tree is inherently preserved, it saves you from having to manually reconstruct the graph, i.e. less human error from having to graft each task branch onto the proper corresponding commit of the rebased Dev branch. It's just a matter of resetting the Dev and task branch markers onto the correct parent commit, which corresponds to the order they were used/named in the octopus merge.
If you have to do this kind of thing a lot, this should be straightforward to script and use as an alias.