You will probably get the most out of classes if you read the text ahead of time. This varies by the lecturer's style, but try at least skimming the material (or notes from the last class if there is no text). You don't have to understand 100% of the material before the lecture. Try to identify material that you don't know, and pay special attention to that during class. If you still don't understand, then try to ask at least one question during class, and if that doesn't satisfy you, ask the instructor after class. When you do understand the text, look for differences between the text and the instructor's presentation, both in material and emphasis. If the material is easy, ask yourself how you would present it if you were teaching the class.
When you attend a research lecture, try to do your homework ahead of time, too! Try to find an expository article, or read a few reviews and abstracts of papers in related areas so you know what people in that field find interesting, what is hard, what the key examples are, what techniques seem effective, and what the connections are with other areas. The first 5-15 minutes of the talk may be similar, and they are critical. Understanding the details of a technical talk does little good if you do not know the context.
Keep a few examples in mind. How do the results compare with the basic examples? How much progress is there toward the examples people want to understand? What are the differences between the later examples and basic examples?
Try to understand where you are on the road map for the talk/course/the book which will eventually be written about the theory being developed.