First make sure you understand OSM's basic elements. There are nodes, ways and relations. You can skip relations because they don't contain geometry information (except for multipolygons which aren't used for defining roads).
Ways are defined by two or more nodes. Each way has a reference to all nodes it belongs to. Each node has coordinates and a reference to all ways it belongs to. This means a node can belong to more than one way, too. For example if it is at the end of a way then it will belong to all previous ways as well as to all next ways. Or it is somewhere in the middle of a way where it references all crossing ways because a way doesn't necessarily have to end at a junction.
Hence a curve can consist of one or more ways. So in order to detect curves, you have to look at consecutive nodes and consecutive ways at the same time. You will have to calculate road segments between every two consecutive nodes. The distance between consecutive nodes and the angle between consecutive road segments are the basis for determining if this is a curve or a straight line.