I am writing a book that is set in England, but because I would get the book published in America I don't know what terminology to use. My main character is in the equivalent of 7th grade but in England they would call it Year 8, which might be confusing to my directed audience. Should I stick with American terminology or use English ones?
If you're writing for an American audience, with an American publisher, then use an American dialect for your narration.
But... your character is living in England. Whether she's British or an immigrant or a visitor, she's going to be exposed to the local dialect. She will use local terms when appropriate. If she's in Year 8 in school, she'll say that. She might translate it for her friends and family in the United States, but she wouldn't say "7th grade" when talking to other people at school or in the community.
Your narrator may also do some translation, depending on the audience. If the entire book is simply set in a foreign country you would use local terms but translate prose to American English when appropriate. The only difference between this and a book by an American author that's set in China, for example, is that both countries here speak the same language.
The dialogue in your story will be whatever it would be in real life. If your main character is English then her dialogue will be too. If she's American, she'll probably code switch, meaning she'll use different dialects with different listeners. And even her American speech will be peppered with some local terms. Her year in school will definitely be whatever it's called. Just like an American graduate student in English will talk about their MPhil program but might say "masters program" for people back home, even though they're not quite the same.
The other issue you have is translation. Some Britishisms aren't immediately obvious to Americans (MPhil being one of them). So use context so your readers can figure it out (at least get the gist when it's a term that isn't vital to know) or show your character explaining the terms to an American listener (don't overdo this, it gets tedious). Be aware of what your American audience won't know (use beta readers for this) and tweak it.
Use English English except where doing so would cause confusion, in which case use neutral words. If you can't do that, maybe clarify with extra information, (e.g. for "Year 8", you could also add in the age of the character, which makes it clear what grade that year represents) or if you absolutely have to, a footnote or have the narrator explain or something.
The reason being, since you're going out of your way to set the book in England, and having the main character be English, you want to give it an English flavour, not an American one, otherwise what's the point in setting it in England at all?
By far the most successful young-adult novels in history, Harry Potter, use British spellings, terminology, idioms, and slang—and they did nothing to stop those novels from being more successful than any other. References to prefects and so on, slang like “snogging” etc., caused no problems. For that matter, few Americans had ever even heard the name “Hermione” before, and just about no one I knew was actually certain how it was pronounced until the movies came out. And none of that mattered, because the audience was enjoying the stories.
I think you will find far greater success in general if you don’t underestimate your audience—young adults are quite capable of figuring things out from context clues, or hitting a search engine if all else fails, and will happily do so if they care enough to understand the words you use. The differences between British English and American English simply aren’t that large in the first place to make this an overly-onerous burden—provided they actually like your story enough to bother. The choice of terminology is very, very unlikely to make the difference.
You could have scenes with a family next door or in the next apartment/flat that just moved in from the USA or Canada. Possibly the protagonist could often have to stop and mentally translate their American phrases into British phrases. And so the readers would learn what those British phrases mean at that time, before the British characters use them.
Or maybe the protagonist's family watches American made television shows as well as British shows, and they sometimes have to translate American phrases from the show into to English equivalents, thus showing the readers what those English phrases mean.