I planned out to write a trilogy and the first draft of book one is now completed. I want to know if I should edit this draft before starting on the second book.
In my opinion, you should.
It's a good thing to plan ahead for sequels, but a first draft is not a finished book.
There are at least two reasons that I can see to edit before going forward:
You may want to start sending your book one to an editor. In that case, it's way better to get out of the way any error, at least, the most amateurish ones. Don't get me wrong - drafts will always have errors (even simple typos) but the first one is particularly vulnerable. You may want to be sure that there is no major issue in the structure of the story, in character development, no inconsistencies in the plot and so on. Also, it would be nice to rework your introduction to "hook in" any potential reader.
Before you continue with book two, you may want to be sure that you have solid ground to build upon. Even if now you may have the impression that book one is perfect, this is not always the case. Make sure that book one is "solid" in terms of plot and characters, and that it stands on its legs without any major issue. It's better to rewrite some chapters now rather than risking to rework an entire trilogy from the start (as small the risk might be).
Trilogies are rarely, if ever, published back-to-back. Instead, first one book is published, then, if it is successful, the second one, then the third.
What this means is, when you query an agent, you have Book 1 finished to a T (as you would with a stand-alone book, when querying an agent). You also mention that you already have books 2 and 3 of the trilogy outlined. ("Outlined" is a flexible term, but since you're planning it to be a trilogy, you definitely should have something - you can't just realise mid-way that things aren't working and you'd need to scrape the whole thing.) Since querying an agent takes a lot of time, you will be making progress on Book 2 while attempting to get Book 1 published.
Why mention that Books 2 and 3 are already in progress, when you're only querying with Book 1? Because you intent to write a trilogy, so the agent would need to know that this intention is not an amorphous sort of intention, but an "already started working" intention. From the experience of now successful writer Jim Butcher:
[editor] was wavering until she heard that I had three books already finished, and then she was a lot more interested. (source)
(To clarify, Jim started querying agents when he had only the one manuscript. In the time it took him to find an agent willing to represent him, he had finished two more, and had the outline for several more to come.)
So, since you need to have Book 1 finished to a T in order to start querying agents, edit it now, start writing the second book after you're completely 100% finished with the first.
If you are a strong plotter, you have likely been sneaking ahead and laying the groundwork for themes and subplots that will not be resolved until much later in the series. With the first draft of Book 1 complete, make course-corrections to your master plot and timeline.
You now have a much better idea of the pace and characters. Touch up the the other two outlines, and check for themes that come later that could be seeded or hinted in the first book. Also, give some thought to how these later books will subvert what you have "promised the reader" in the first story. You may want to exaggerate or lean into an aspect that later gets dismantled.
This is not writing Books 2 and 3, this is making sure everything is included in Book 1 before your begin the re-write. The priority is Book 1, so you also need to balance "the future" with the themes and character arcs that are self-contained. Make sure characters are not anticipating what happens later. Make the present the thing that matters most as if there are no sequels planned.
If you are a discovery writer, you hopefully still have a master outline otherwise you would not be saying you are writing a trilogy. While you leave hints and germinate seeds for later plots, the priority is a sense of closure within Book 1. It should "land" on a relatively stable status quo after the plot and character arcs in the first book.
I ended up moving certain anticipated plot points to later books because they weren't being thematically addressed within the first. I also do this with chapters, move plot points so they are contained within the part of the story that tackles them thematically.
For me, 2nd draft is mostly throwing things out and simplifying so the action is direct, and the characters are defined habitually rather than through big events and major crises. The Big Action Scenes™ are where we should see characters revealed as themselves, not debating who they want to be – that debate into their true selves is what the rest of the book is for. I don't get a true sense of what they've learned about themselves, and how they apply what they learn in the final resolution, until I've gotten through the 1st draft and the story has been scrubbed.
This leaves a discontinuity going into the later books because even as a chronic plotter who skips ahead, my master outline is nowhere near as nuanced as the characters I've discovered writing Book 1. The later outlines are still half-baked scenarios and Mary Sue moments that feel a bit silly by comparison, but that's a good thing for me because I want the open-ended optimism of a fresh Book 2, rather than a continuation of the end-tone and themes from Book 1. In Book 2, the characters are starting fresh at the beginning of a new journey. While I have been plotting ahead, I'm not writing ahead. I like that each book in the series will have its own character arcs and themes. They build on each other, rather than continue where the previous left off.
Write at least part of your second book before editing your first.
I'm going to take a slightly different slant than most of the other contributors and suggest that you write about half of your second book before you go back and do a serious rewrite of the first.
The reason? Because almost inevitably, as you start writing your second book, you'll realize that you need or want to make some changes to your previous book. You'll realize that you want to include a little bit more foreshadowing at the end of book one to set up the plot for book two; or you'll want to change the result of a scene or even an entire arc. You might find that the scene in which the trusted sidekick sacrifices his life for the hero should come at the climax of the second book rather than the first. Or that your villain, who was setting up Plan A at the end of the first book, should really be setting up Plan B instead, because the first half of the second book needs to deal with Plan B, saving Plan A for later. You might find halfway through the second book that you don't really have three books of material, only two and a half, so you'll need to rewrite significant chunks of the first book for your final opus to fit into an whole number of books.
If you go back and do your serious editing now, you'll almost invariably find that a lot of your fine-tuning gets wasted. Even worse, you might not be willing to make the necessary changes because you've already spent so much time perfecting those scenes that cutting them is just too painful.
To avoid this extra work (and unnecessary pain), I suggest writing more than just the first book before doing an editing sweep. Personally I find that I almost never want to go back and change events that happened more than half a book ago; hence my recommendation of writing half the second book before editing the first, but you might find that a quarter or a third is sufficient for your purposes. Once the second book is well underway -- once you don't just suspect but actively know that you won't need to make significant changes -- then is the time to prepare the first book for publication.
You have to do what works for you, and that includes listening to the advice of others, but then doing what works best for you.
I've personally done both.
The advantage of finishing one book before starting the next is that you get it out the door and making money for you.
The advantage of completing at least the first draft of the entire trilogy is that you then have the entire work available for improvements. Remember: no plan survives first contact with the enemy. So that plot twist you wrote in Book 1, Chapter 17 may really, really screw things over somewhere in Book 3. Likewise, you may decide that you need to introduce a new character, and you don't want to do it in the void. Or remove a character that makes a brief appearance but never shows up again.
A danger of publishing book 1 first is that if you get pulled in other directions, your book 2 might not come out for a while, and your readers could become quite testy if it's taking what they feel is too long.
In other words: both answers are perfectly legitimate.
Note that I do what works at the time. If I'm in a mood to create, I write. But at some point, I go back and edit. I let my moods drive me. It does no good to stare at a screen, with the words not flowing. On the other hand, it can cost you valuable creative time if instead you edit.
So do what works for you.