Adjectival step by step
According to Wiktionary, step by step is the adverbial form, whereas step-by-step is the adjectivial. So your second example is the correct one.
According to Wiktionary, step by step is the adverbial form, whereas step-by-step is the adjectivial. So your second example is the correct one.