Retina, 47 bytes
^|\\
$&
+m`^( *)( /|\\)(/| \\)
$1$2¶$1$3
m`^
Try it online! Link includes test cases. Explanation:
^|\\
$&
Add a space at the beginning of each line and before each \
.
+m`^( *)( /|\\)(/| \\)
$1$2¶$1$3
Consider the first two characters of the string. If the first is a /
then the indent needs to be decremented; this is achieved by including the preceding space in the capture (which always exists because the first stage added it); if the second is a \\
then it needs to be incremented; this is achieved by including the space that the first stage added in the capture. Having given the second character the correct indent, the stage is repeated for the second and third character etc.
m`^
Remove the extra indent.