I think you can leave differently, depending on the circumstance. It is risky, and you have to know your workplace. You could go to your boss and say, "I have really loved all that I've learned here, and I love the people I work with, but I don't feel that it's the best fit for me anymore. I wanted to let you know that I'm looking for other work and I expect to leave in the next 2/4/6 months. I'll definitely give you 2 weeks notice of when I find something and I'm happy to help train people now."
I have done that with part time jobs where there is some high turnover, or everyone knows it is usually "temporary" of 1-3 years. They don't expect many lifers, and they are grateful for the warning and honesty. However, I wouldn't do it any sooner than when you are about to start applying, because there is always a chance they say, "Good luck, your last day is tomorrow." I think one way to evaluate is how the workplace reacts when someone 1) leaves to go back to school, 2) leaves to retire, 3) leaves to care for children full time, and 4) moves away, and 5) otherwise quits reasonably.
Where I currently work, people give 2 weeks or a month notice, but are sometimes escorted out the door 3-5 days later. I wouldn't do this. Loyalty is over valued here, and admitting you are going to work someplace else, even another STATE is disloyal.