Here is the passage from his message to Philip Melancthon:
If the mercy is true, you must therefore bear the true, not an imaginary sin. God does not save those who are only imaginary sinners. Be a sinner, and let your sins be strong, but let your trust in Christ be stronger, and rejoice in Christ who is the victor over sin, death, and the world. We will commit sins while we are here, for this life is not a place where justice resides. We, however, says Peter (2. Peter 3:13) are looking forward to a new heaven and a new earth where justice will reign. It suffices that through God's glory we have recognized the Lamb who takes away the sin of the world. No sin can separate us from Him, even if we were to kill or commit adultery thousands of times each day. Do you think such an exalted Lamb paid merely a small price with a meager sacrifice for our sins? Pray hard for you are quite a sinner.
Elsewhere, Luther talks about committing a token sin (of sorts) to spite the devil, by which he means if the devil is foisting legalism upon you on matters that are not real sins (drinking, mowing your lawn on Sunday, etc.), you could spite him by doing just that. But in this instance he is not literally advocating sin. He is only saying that Christ died for what sin truly is: bold, willful rebellion against God. Let your sin be named as that. Cop to it. You don't have to pretend your sins are tame. Be a bold sinner. But be a bolder believer in the redemption of your depravity.