I created the outline by duplicating the text, selecting the main text and expanding the selection by 5px and then just delete the selection on the duplicated layer.
How can I recreate this effect in Illustrator?
In Adobe Illustrator, you could get that effect in using a similar method as you did with Adobe Photoshop, but different tools.
1) Type your text and duplicate it to have 2x the same line of text. Use a different color for one of the text.
2) Align your 2 sets of texts with a light angle as on your picture. What you'll do next (as explained in the next points) will be to remove the parts that the text on the front will cover, and move slightly that text in the back to create the effect on your sample.
3) Add some stroke to the text that is in the background to thicken it. You might need to make a few tests. Also, on the "stroke" tools, you should choose the "round corner" to make sure you don't see weird pointy edges.
4) Select all the text and use the command "Create Outline" in the "type" menu.
5) Open your "pathfinder" tools, select all that vectorized text and use the "divide" function.
6) Ungroup all the texts; they will be grouped when divided.
7) Select the color of the text in the background or foreground; you can select only one part and then go in the menu "select" and use "select similar" then "same fill color". This will select all the parts of the design that are the same color.
8) Then slightly move that selected text as you wish to create the same kind of outline you see on your picture.
You might need to make some small tweaks or erase some tiny bits left from your "divide" but if you play around with these tips above, you should get something close to what you want to achieve.