Transferring schools during PhD
There are many reasons to transfer and only a few of them have any ethical complications. If you have committed to complete experiments in some elaborate scientific field and others depend on you doing that, then you need to deal with those promises. But for the most part, you are free to go and your willingness to inform people early enough that the old institution can make a smooth transition is courteous if not ethically required. 

But there is little in life worse than sticking with something that isn't right for you. You only get one run around the track, of course, so make it a good one. 

People change as they learn. If they didn't, there would be little point in it. Other people understand that change occurs, so I expect that there will be very little "frowning", unless you are missed. People can be expected to wish you well and, generally, be happy for your growth. You are also early enough in your studies that there should be little impact (absent situations as described in the first paragraph here). 

But yes, give people early warning so that your place can be filled. I think that any move to "expel" you early would be unethical and, I hope, illegal. There are a few exceptions, of course, if your studies put you in contact with especially sensitive or dangerous information. Those situations are rare, but in such situations, early warning may be especially needed.