Yes that is allowed as long as it is not encouraging others to commit the same sin. If someone looks up to you and you tell them you used to commit a particular sin, this person will see that it is okay for him to commit that sin and repent later. You should always make it seem as if someone committed this sin and not yourself.