I did for a couple years before I came out. It took a while for me to accept myself, because I was afraid of rejection. I was in denial for a while because of all of that. I would tell my self every night "I am a guy, I am trans, stop lying to yourself Grayson". Yet I was so unsure of myself that I couldnt come out without backing out of it, until I finally understood and came to terms with who I am about a year ago.
Now that I am out, I've mentally transitioned myself as best as I can, it helps me pass too I think.