>howAccidentally a few times, then mostly from the later acquired habit of backtracking through memories trying to remember something or other. Basically anything that makes you more mindful will carry over in your dreams and increase the likelihood of you realising what's going on. Once you've done that, staying in the dream instead of waking up might be a different matter altogether - or not, you'll have to see for yourself.
>>7303460LaBerge's book is the classical modern text, a bit dated but it covers all the essentials and more. Might be slightly too scientific in its approach for the general public, I don't know. Otherwise there's a ton of recent, more direct and pop-oriented books that are more or less equivalent to each other, as long as you exert your good judgement in avoiding the obvious claptrappy new-age ones. On the other end of the spectrum there's a 19th Century thesis that is probably the oldest work dealing this explicitly with the subject, and it's a fine account of a man's experience with investigating dreams but may not be what you're looking for.
Either way I would advise you give it some time to try and experiment on your own first, before getting influenced by all these "lucid dreaming" systems. Could give you a more intuitive understanding of your own thought processes, and I think it's more rewarding to then compare your own experience to the fairly consistent theories and methods everybody comes up with instead of applying them on your one-time-only blank canvas.