You can compare the bounds of the text frame against it's page bounds. Then you can easily get the answer.
Using textFrame.geometricBounds and page.bounds, you can get those values. Result will be an array in the format [y1, x1, y2, x2]. compare these values.
i.e. Text frames bounds should be inside the page bounds.