How can I avoid learning secrets at a research internship that would block me from legally pursuing research interests after it's over? I'm applying for a reserach internship at a company at which I just finished a software internship.

I also want to go to grad school to get a Master's degree in computational neuroscience.

Does anyone have experience with where the legal boundaries are for this? The company obviously has private intellectual property that I might be working with, and I'm concerned that working with them would put me under non-disclosure agreements that would conflict with my research interests.

How separate should the things I research at the internship be with what I plan to study at university be? Should I just avoid taking on an a research internship?
You should take the internship - congrats on that. Yes, you may learn some stuff that is proprietary to the company - it will be quite specific, and far more application oriented than anything you are likely to do in grad school. Working there will give you some good ideas about how things work in the real world (the fanciest ideas don't always produce good results). Finally, they know you are an intern - the probably won't have you working on the deepest darkest proprietary stuff.

You are not now, and will not be, the first or last student intern at a company that has proprietary information. Just be clear, before you go, what they consider as 'theirs'.